package top.dreamlove.demo;

import java.io.*;

public class Method1 {
    public void copy() throws Exception {
        String pathFather = "C:\\123pan\\QFarm6.3_FinalTest_20120716.7z";

        String pathSon = "D:\\360Downloads\\copyFile.7z";


        try(
                FileInputStream needCopyFile = new FileInputStream(pathFather);
                BufferedInputStream needCopyFileBuffer = new BufferedInputStream(needCopyFile);

        //需要传入OutputStream
            FileOutputStream address = new FileOutputStream(pathSon);
            BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(address);//输出路径
        ){
            int b;
            while (( b = needCopyFileBuffer.read()) != -1){
                bufferedOutputStream.write(b);
            }

        }catch (Exception e){
            System.out.println("e = " + e);
        }
    }
}
